﻿using System;

namespace Dogshow.Model
{
    public class FciGrupa : IComparable
    {
        public int Id { get; set; }
        public string Naziv { get; set; }
        public string Opis { get; set; }

        public bool Equals(FciGrupa other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return other.Id == Id;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof(FciGrupa)) return false;
            return Equals((FciGrupa)obj);
        }

        public override int GetHashCode()
        {
            return Id;
        }

        public int CompareTo(object obj)
        {
            var inst = obj as FciGrupa;
            if (inst == null) return 1;
            return Id.CompareTo(inst.Id);
        }

        public override string ToString()
        {
            return Naziv;
        }
    }
}